﻿/*
杨辉三角形 
Time Limit:1000MS  Memory Limit:32768K


Description:
打印杨辉三角形。

Input:
输入数据含有不多于50个的正整数n(n≤10)。 
Output:
三角形的每个项占3个字符宽。每个三角形之间空一行，最后的三角形之后没有空行。见样本输出。 
Sample Input:
10 3
Sample Output:
							 1
						  1 	1
					   1	 2     1
					1     3 	3     1
				 1     4	 6     4	 1
			  1 	5    10    10     5 	1
		   1	 6    15	20    15	 6     1
		1     7    21    35    35    21 	7     1
	 1     8	28    56	70    56	28     8	 1	
  1 	9    36    84   126   126    84    36     9 	1

		1
	 1     1
  1 	2     1	
  */
#include <iostream>
#include <cstdlib>
#include <iomanip>
using namespace std;

int main()
{
	unsigned binomials[] =
	{
		2,				//1
		3,				//2
		4, 6,			//3
		5, 10,			//5
		6, 15, 20,		//7
		7, 21, 35,		//10
		8, 28, 56, 70,	//13
		9, 36, 84, 126	//17

	};
	int indexies[][2] =
	{
		{0, 1}, {1, 2}, {2, 4}, {4, 6}, {6, 9}, {9, 12}, {12, 16}, {16, 20}
	};
	bool first_time=true;
	for (unsigned n; cin >> n && n;)
	{
		if(!first_time)
			cout<<endl;
		first_time=false;

		cout << setw(n * 3) << 1 << endl;
		--n;
		if (n > 0)
		{
			cout << setw(n * 3) << 1 << setw(6) << 1 << endl;			
			--n;
			unsigned k = 0;
			for (unsigned i = 0U; i < n; ++i)
			{
				cout << setw(3 * (n - i)) << 1;

				int j = indexies[i][0];
				for (; j < indexies[i][1]; ++j)
				{
					cout << setw(6) << binomials[j];
				}
				--j;
				if (0 == i % 2)
					--j;
				for (; j >= indexies[i][0]; --j)
				{
					cout << setw(6) << binomials[j];
				}

				cout << setw(6) << 1 << endl;
			}
		}

	}

	return EXIT_SUCCESS;
}